<template>
  <el-date-picker v-bind="$attrs" :shortcuts="shortcuts"></el-date-picker>
</template>
<script lang="ts" setup>
defineProps({
  shortcuts: {
    type: Array,
    default: () => {
      return [
        {
          text: '今天',
          value: new Date(),
        },
        {
          text: '昨天',
          value: () => {
            const date = new Date()
            date.setTime(date.getTime() - 3600 * 1000 * 24)
            return date
          },
        },
        {
          text: '一周前',
          value: () => {
            const date = new Date()
            date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
            return date
          },
        },
      ]
    },
  },
})
</script>
